package com.yingside.collection.game;

public class Monster extends Enemy{


	public Monster(int type){
		switch(type){
			case 1:
				this.name = "河蟹";
				this.hp = 50;
				this.attack = 8;
				this.defence = 6;
				this.money = 50;
				break;
			case 2:
				this.name = "软泥怪";
				this.hp = 70;
				this.attack = 9;
				this.defence = 8;
				this.money = 80;
				break;
			case 3:
				this.name = "先锋";
				this.hp = 100;
				this.attack = 11;
				this.defence = 9;
				this.money = 100;
				break;
			case 4:
				this.name = "男爵";
				this.hp = 150;
				this.attack = 18;
				this.defence = 16;
				this.money = 200;
				break;

		}
	}


	/*public void injured(Hero h){
		int lostLife =GameUtil.getLostLife(h.getAttack(), this.defence);


		this.hp -= lostLife;

		if(this.hp <= 0){
			System.out.println(this.name + "死亡...");
			//在函数中,如果想让代码不再继续往下执行,可以直接使用return返回
			//由于这个函数没有返回值,所以直接写一个return,就表示函数在这里直接结束
			//而且注意,这种写法肯定要和if判断配合起来一起使用
			return;
		}

		System.out.println("======怪兽受伤======");
		System.out.println("英雄的攻击力:" + h.getAttack());
		System.out.println("怪兽的防御力:" + this.defence);
		System.out.println(this.name + "受到"+lostLife+"点伤害");

		System.out.println(this.name + "剩余血量:" + this.hp);
	}*/

	//怪兽反击英雄
	public void response(Hero h){
		System.out.println(this.name + "挥舞着锋利的爪子,冲向了-->" + h.getName());
		h.injured(this);
	}




}

